package sharewithus.content.dao;

import java.util.List;

import sharewithus.content.dto.Feed;
import sharewithus.content.dto.FeedRelationship;

/**
 * 
 * @author bruce Wang interface of the cache
 */
public interface IFeedRelationshipCache extends IFeedRelationshipDao {

	public List<FeedRelationship> getSubscribedFeeds(String subscriberUserId,
			int pageSize, int pageNum);

	/**
	 * 
	 * @param feed
	 *            build owner - feeds relationship in cache
	 */
	void pushUserFeedRelationship(Feed feed);

	/**
	 * 
	 * @param ownerId
	 * @return get owner's all stored feeds in the cache
	 */
	List<String> getUserFeedIds(String ownerId);

	/**
	 * 
	 * @param ownerId
	 * @param pageSize
	 * @param pageNumber
	 * @return get owner's all stored feeds in the cache with pagination
	 * 
	 */
	List<String> getUserFeedPageIds(String ownerId, int pageSize, int pageNumber);
	
	
	/**
	 * 
	 * @param feed
	 * @param commentFeed
	 */
	public void pushFeedCommentRelation(Feed commentFeed);
	
	/**
	 * 
	 * @param feedId
	 * @return
	 */
	public List<String> listCommentIds(String feedId);

	/**
	 * 
	 * @param feedId
	 */
	public void incrCommentsCount(String feedId);
	
	
	/**
	 * 
	 * @param feedId
	 */
	public void decrCommentsCount(String feedId);
	
	/**
	 * 
	 * @param feedId
	 */
	public int getCommentsCount(String feedId);
	
	/**
	 * 
	 * @param feedId
	 * @param userId
	 */
	public void favorFeed(String feedId, String userId);
	
	/**
	 * 
	 * @param feedId
	 * @param userId
	 */
	public void unFavorFeed(String feedId, String userId);
	/**
	 * 
	 * @param userId
	 * @return
	 */
	public List<String> getFavorFeedIds(String userId);
	
	/**
	 * 
	 * @param userId
	 * @param pageSize
	 * @param pageNumber
	 * @return
	 */
	public List<String> getFavorFeedIds(String userId, int pageSize, int pageNumber);
	
	/**
	 * 
	 * @return
	 */
	public int getUserFeedCount(String userId);
	
	
	/**
	 * 
	 * @param userId
	 */
	public void incrUserFeedCount(String userId);
	
	
	/**
	 * 
	 * @param userId
	 */
	public void decrUserFeedCount(String userId);
}
